package com.example.async_demo.listener;

import com.example.async_demo.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * <P> @Author: SongKeCheng
 * <P> Type: Class
 * <P> Description:
 * <P> Date: 2024/6/4:20:50
 */

@SuppressWarnings({"unchecked", ""})
@Component
public class LogEventListener implements ApplicationListener<LogEvent> {
    private static final Logger log = LoggerFactory.getLogger(LogEventListener.class);

    @Autowired
    private UserService userService;

    @Override
    public void onApplicationEvent(LogEvent event) {
        userService.addLog();
    }
}
